package cn.xej.test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProductAllServiceImpl implements ProductAllService{

    private final ProductFactory productFactory;

    public ProductAllServiceImpl(ProductFactory productFactory) {
        System.out.println("............");
        this.productFactory = productFactory;
    }

    @Override
    public String getProductName(Integer id, String type) {
        ProductModelService productModelService = productFactory.getProductService(type);
        return productModelService.getProductName(id);
    }

    @Override
    public String getInfo(Integer id, String type) {
        return null;
    }

}
